//
//  PresentData.m
//  FLLGodOfCooking
//
//  Created by LL.F on 16/09/07
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "PresentData.h"
#import "PresentShequ_Marrow.h"
#import "PresentShequ_Topics.h"
#import "PresentShequ_Talent.h"
#import "PresentBanner.h"

@implementation PresentData

+ (NSDictionary *)objectClassInArray{
    return @{@"shequ_marrow" : [PresentShequ_Marrow class], @"shequ_topics" : [PresentShequ_Topics class], @"shequ_talent" : [PresentShequ_Talent class], @"banner" : [PresentBanner class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"shequ_marrow"]) {
        NSMutableArray<PresentShequ_Marrow *>  *marrowArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            PresentShequ_Marrow *data = [PresentShequ_Marrow modelWithDic:dic];
            [marrowArray addObject:data];
        }
        _shequ_marrow = marrowArray;
    }
    if ([key isEqualToString:@"shequ_topics"]) {
        NSMutableArray<PresentShequ_Topics *>  *topicsArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            PresentShequ_Topics *data = [PresentShequ_Topics modelWithDic:dic];
            [topicsArray addObject:data];
        }
        _shequ_topics = topicsArray;
    }
    if ([key isEqualToString:@"shequ_talent"]) {
        NSMutableArray<PresentShequ_Talent *>  *talentArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            PresentShequ_Talent *data = [PresentShequ_Talent modelWithDic:dic];
            [talentArray addObject:data];
        }
        _shequ_talent = talentArray;
    }
    if ([key isEqualToString:@"banner"]) {
        NSMutableArray<PresentBanner *>  *bannerArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            PresentBanner *data = [PresentBanner modelWithDic:dic];
            [bannerArray addObject:data];
        }
        _banner = bannerArray;
    }
}
@end
